<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<x:parse xml="${param.xmlstr}" var="xmlData" />
<c:set var="nature_value">
    <x:out select="$xmlData/data/organizations/organization[@submit_org='1']/nature_value" />
</c:set>
<div class="t_bar">
    项目基本情况
</div>
<table class="t_css" id="basic_tab" width="100%" border="0" cellpadding="0" cellspacing="1">
    <col style="width: 20%" />
    <col style="width: 30%" />
    <col style="width: 20%" />
    <col style="width: 30%" />
    <tr class="li_1">
        <td align="right">项目名称：</td>
        <td colspan="3">
            <input type="text" name="proposal/zh_title" id="zh_title" disabled onchange="reqName()" style="width: 82%;" class="gray"  value="<x:out select="$xmlData/data/proposal/zh_title"/>" label="项目名称">
        </td>
    </tr>
    <tr class="li_2">
        <td align="right"><span class="color_red">*</span>归口管理部门：</td>
        <td colspan="3">
            <c:set var="recomend_org">{'id':'<x:out select="$xmlData/data/proposal/recomend_org_value" />','name':'<x:out select="$xmlData/data/proposal/recomend_org_name" />'}</c:set>
            <cpt:tree key="recommended_org" cacheable="false" className="hn_iuput_kuang " readonly="true" value="${recomend_org}"  id="recomend_org" showPattern="all" shieldPattern="0"
                      topCheckbox="false" onClick="initTreeValueExt" />
            <input type="hidden" id="recomend_org_value" name="proposal/recomend_org_value" style="width: 80%;" class="required" value="<x:out select="$xmlData/data/proposal/recomend_org_value" />" label="归口管理单位">
            <input type="hidden" name="proposal/recomend_org_name" style="width: 80%;" value="<x:out select="$xmlData/data/proposal/recomend_org_name" />">
        </td>

    </tr>
    <tr class="li_1">
        <td align="right"><span class="color_red">*</span>内设学院或机构<br/>（没有可填无）：</td>
        <td colspan="3">
            <input type="text"  name="proposal/built_institute" class="required" onchange="synchronizationAmount1()"  id="built_institute" style="text-align: left;width: 82%;" maxlength="30"
                   value="<x:out select="$xmlData/data/proposal/built_institute"/>" label="内设学院或机构" >
        </td>
    </tr>
    <tr class="li_2">
        <td align="right"><span class="color_red">*</span>项目类型：</td>
        <td colspan="3">
            <c:set var="project_type_value"><x:out select="$xmlData/data/proposal/project_type_value" /></c:set>
            <cpt:select style="width: 50%;" id="project_type" key="project_types" className="selectWidth2" onChange="initControlValue('applicant_subject')" value="${project_type_value}"></cpt:select>
            <input name="proposal/project_type_value" type="hidden" value="<x:out select="$xmlData/data/proposal/project_type_value" />" class="required " label="项目类型"/>
            <input name="proposal/project_type_name" type="hidden" value="<x:out select="$xmlData/data/proposal/project_type_name" />" />
        </td>
    </tr>
    <tr class="li_1">
        <td align="right"><span class="color_red">*</span>是否与其他已申报的<br/>项目研究有交叉关联：</td>
        <td colspan="3">
            <c:set var="emerging_enterprise_value"><x:out select="$xmlData/data/proposal/emerging_enterprise_value" /></c:set>
            <cpt:checkbox key="no_yes" name="emerging_enterprise" repeatColumn="4" value="${emerging_enterprise_value}"  onClick="emerging_enterprise1" tagType="radio" ></cpt:checkbox>
            <span class="hid">（项目名称/项目类别）</span><input type="text" id="other_content" class="hid "     maxlength="100"
                   name="proposal/other_content"
                   style="border: none; border-bottom: 1px solid gray; "
                   label="是否与其他已申报的项目研究有交叉关联-->项目名称与项目类别"
                   value="<x:out select="$xmlData/data/proposal/other_content" />" /><span class="hid"></span>
            <input type="hidden" id="emerging_enterprise_value" name="proposal/emerging_enterprise_value" class="required" value="${emerging_enterprise_value}" label="是否与其他已申报的项目研究有交叉关联">
            <input type="hidden" name="proposal/emerging_enterprise_name" value="<x:out select="$xmlData/data/proposal/emerging_enterprise_name" />">
        </td>
    </tr>

    <tr class="li_2">
        <td align="right"><span class="color_red">*</span>是否安徽省十一大新兴产业：</td>
        <td colspan="3" align="center" >
            <c:set var="emerging_enterprises_value"><x:out select="$xmlData/data/proposal/emerging_enterprises_value" /></c:set>
            <cpt:checkbox key="no_yes" name="emerging_enterprises"  width="70px"  repeatColumn="4" value="${emerging_enterprises_value }"  onClick="emerging_enterprises" tagType="radio" ></cpt:checkbox>
            <input type="hidden" id="emerging_enterprises_value" name="proposal/emerging_enterprises_value" class="required" value="${emerging_enterprises_value}" label="是否安徽省十一大新兴产业">
            <input type="hidden" name="proposal/emerging_enterprises_name" value="<x:out select="$xmlData/data/proposal/emerging_enterprises_name" />">

            <div id="emerging_industries_value_div" style="display: none" >
                <c:set var="emerging_industries_value"><x:out select="$xmlData/data/proposal/emerging_industries_value" /></c:set>
                <cpt:checkbox key="emerging_industries1" name="emerging_industries"  width="70px"  repeatColumn="4" value="${emerging_industries_value }" ></cpt:checkbox>
                <input type="hidden" id="emerging_industries_value" name="proposal/emerging_industries_value" class="required" value="${emerging_industries_value}" label="是否安徽省十一大新兴产业-->安徽省十一大新兴产业">
                <input type="hidden" name="proposal/emerging_industries_name"  value="<x:out select="$xmlData/data/proposal/emerging_industries_name" />">
            </div>
        </td>
    </tr>

    <tr class="li_1">
        <td align="right"><span class="color_red">*</span>是否产学研合作项目：</td>
        <td colspan="3" align="center">
            <c:set var="industry_university_value"><x:out select="$xmlData/data/proposal/industry_university_value" /></c:set>
            <cpt:checkbox key="no_yes" name="industry_university"  width="70px"  repeatColumn="4" value="${industry_university_value }"   tagType="radio" ></cpt:checkbox>
            <input type="hidden" id="industry_university_value" name="proposal/industry_university_value" class="required" value="${industry_university_value}" label="是否产学研合作项目">
            <input type="hidden" name="proposal/industry_university_name" value="<x:out select="$xmlData/data/proposal/industry_university_name" />">
        </td>
    </tr>
    <tr style="display: none;"></tr>
    <tr class="li_2">
        <td  align="right"><span class="color_red">*</span>“336614”所属领域：</td>
        <td  colspan="3" align="left" >
            <input type="text"  name="proposal/applicant_subject" class="required" maxlength="50" style="text-align: left;width: 82%" placeholder="从领域中选其一填写。如均不属于，则填其他。"
                   value="<x:out select="$xmlData/data/proposal/applicant_subject" />" label="“336614”所属领域" >
        </td>
    </tr>
    <tr class="li_1">
        <td align="right"><span class="color_red">*</span>项目联系人姓名：</td>
        <td>
            <input type="text"  name="proposal/contact_psn_cname" class="required" maxlength="20" style="text-align: left;"
                   value="<x:out select="$xmlData/data/proposal/contact_psn_cname" />" label="项目联系人姓名" >
        </td>
        <td align="right"><span class="color_red">*</span>联系人手机：</td>
        <td>
            <input type="text"  name="proposal/contact_psn_mobile" class="required mobile" style="text-align: left;"
                   value="<x:out select="$xmlData/data/proposal/contact_psn_mobile"/>" label="联系人手机" onfocus="InitInput.setNumber(this,11,0,0);">
        </td>
    </tr>
    <tr class="li_2">
        <td align="right">项目负责人姓名：</td>
        <td>
            <span name="proposal/fzr_name"><x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/basic_info/zh_name"/></span>
        </td>
        <td align="right">负责人电子邮箱：</td>
        <td>
            <span  name="proposal/fzr_email"  ><x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/contact/email"/></span>
        </td>
    </tr>
    <tr class="li_1">
        <td align="right">项目负责人手机：</td>
        <td>
            <span name="proposal/fzr_mobile"><x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/contact/mobile"/></span>
        </td>
        <td align="right">负责人电话：</td>
        <td>
			<span  name="proposal/fzr_tel">
				<x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/contact/tel_work"/></span>
        </td>
    </tr>
    <tr class="li_2">
        <td align="right"><span class="color_red">*</span>项目开始日期：</td>
        <td align="center">
<%--            <span name="proposal/start_date"><x:out select="$xmlData/data/proposal/start_date" /></span>--%>
            <c:set var="start_date"><x:out select="$xmlData/data/proposal/start_date"/></c:set>
            <cpt:date id="start_date" name="proposal/start_date" label="项目开始日期" value="${start_date}" className=" required  date  "  ></cpt:date>
        </td>
        <td align="right"><span class="color_red">*</span>项目结束日期：</td>
        <td>
            <%-- <span name="proposal/end_date"><x:out select="$xmlData/data/proposal/end_date" /></span>--%>
<%--            <c:set var="pro_end_date"><x:out select="$xmlData/data/proposal/end_date"/></c:set>--%>
<%--            <cpt:date id="end_date" name="proposal/end_date" label="项目结束日期" value="${param.pro_end_date }" className=" required  date dateCompareAfterE:end_date:start_date "></cpt:date><br/><span class="color_red">项目执行期不得超过三年</span>--%>
            <c:set var="pro_end_date"><x:out select="$xmlData/data/proposal/end_date"/></c:set>
            <cpt:date id="end_date" name="proposal/end_date" label="项目结束日期" value="${pro_end_date}" className=" required  date dateCompareAfterE:end_date:start_date "></cpt:date><br/><span class="color_red">项目执行期不得超过三年</span>
        </td>
    </tr>

<%--    <tr class="li_1">--%>
<%--        <td align="right"><span class="color_red">*</span>项目申请金额（万元）：</td>--%>
<%--        <td colspan="3">--%>
<%--            <input type="text" name="proposal/request_amount" class="required" id="request_amount" onfocus="InitInput.setNumber(this,9,2,2)" style="text-align: right;"--%>
<%--                   value="<x:out select="$xmlData/data/proposal/request_amount"/>" label="项目申请金额" onchange="synchronizationAmount()">--%>
<%--        </td>--%>
<%--    </tr>--%>

</table>
<div class="t_bar">合作单位信息</div>
<table id="inland" border="0" cellspacing="0" cellpadding="0" style="width: 100%;word-break:break-all;" class="table01 t_css">
    <thead>
    <tr>
        <th align="center" width="4%">选择</th>
        <th align="center" width="5%">序号</th>
        <th align="center" width="9%">单位名称</th>
        <th align="center" width="13%">单位地址</th>
        <th align="center" width="9%">合作单位性质</th>
        <th align="center" width="9%">合作形式</th>
        <th align="center" width="8%">合作经费支出（万元）</th>
        <th align="center" width="8%">联系人</th>
        <th align="center" width="8%">电话</th>
        <th align="center" width="12%">是否长三角区域</th>
        <th align="center" width="15%">是否县域单位（不含市辖区）</th>
    </tr>
    </thead>
    <tbody id="inland_tab">
    <tr style="display: none" align="center">
        <td align="center">
            <input type="radio" class="radiobutton" name="selAttendOrg11">
        </td>
        <td align="center">
            <span name="inlands|inland[0]@seq_no">[index]</span>
        </td>
        <td align="center">
            <input name="inlands|inland[0]|org_name" label="单位名称" type="text" required class="input_css required maxlength:300" style="width: 80%;" maxlength="100" value="" />
        </td>

        <td align="center">
            <input name="inlands|inland[0]|org_address" label="单位地址" type="text" required class="input_css required maxlength:300" style="width: 80%;" maxlength="100" value="" />
        </td>

        <td align="center">
            <input name="inlands|inland[0]|coop_org_type" label="合作单位性质" type="text" required class="input_css required " style="width: 80%;" maxlength="100" value="" />
        </td>

        <td align="center">
            <input name="inlands|inland[0]|coop_formal" label="合作形式" type="text" required class="input_css required " style="width: 80%;" maxlength="100" value="" />
        </td>

        <td align="center">
            <input name="inlands|inland[0]|coop_fund_expend" label="合作经费支出" type="text" class="input_css required" style="width: 80%;text-align: right;" maxlength="100" value="" onfocus="InitInput.setNumber(this,9,2,2)"  />
        </td>

        <td align="center">
            <input name="inlands|inland[0]|psn_name" label="联系人" type="text" required class="input_css required " maxlength="100" style="width: 80%;" value="" />
        </td>
        <td align="center">
            <input name="inlands|inland[0]|psn_phone" label="电话" type="text" required class="input_css required " maxlength="20" style="width: 80%;" value="" />
        </td>
        <td align="center">
            <cpt:select id="triangle_region[index]" key="no_yes" name="triangle_region" onChange="initControlValue(this.id);setCooperationUnits()" value="" style="width:85%"></cpt:select>
            <input type="hidden" name="inlands|inland[0]|triangle_region_value" class="required" value=""  label="是否长三角区域" />
            <input type="hidden" name="inlands|inland[0]|triangle_region_name" value=""/>
        </td>
        <td align="center">
            <cpt:select id="county_units[index]" key="no_yes" name="county_units" onChange="initControlValue(this.id);setCooperationUnits()" value="" style="width:85%"></cpt:select>
            <input type="hidden" name="inlands|inland[0]|county_units_value" class="required" value=""  label="是否县域单位" />
            <input type="hidden" name="inlands|inland[0]|county_units_name" value=""/>
        </td>
    </tr>
    <c:set value="0" var="index" scope="page" />
    <x:forEach select="$xmlData/data/inlands/inland" var="inland">

        <c:choose>
            <c:when test="${index<10}">
                <c:set value="0" var="flag" scope="page" />
            </c:when>
            <c:otherwise>
                <c:set value="" var="flag" scope="page" />
            </c:otherwise>
        </c:choose>
        <tr align="center">
            <td>
                <input type="radio" class="radiobutton" name="selAttendOrg11">
            </td>
            <td align="center">
					<span name="inlands/inland[${flag}${index}]@seq_no">
						<x:out select="$inland/@seq_no" />
					</span>
            </td>
            <td>
                <input name="inlands/inland[${flag}${index}]/org_name" label="单位名称" type="text" required class="input_css required maxlength:100" style="width: 80%;" maxlength="100"
                       value="<x:out select="$inland/org_name" />" />
            </td>

            <td>
                <input name="inlands/inland[${flag}${index}]/org_address" label="单位地址" type="text" required class="input_css required maxlength:100" style="width: 80%;" maxlength="100"
                       value="<x:out select="$inland/org_address" />" />
            </td>


            <td align="center">
                <input name="inlands/inland[${flag}${index}]/coop_org_type" label="合作单位性质" type="text" required class="input_css required " style="width: 80%;" maxlength="100"
                       value="<x:out select="$inland/coop_org_type" />" />
            </td>

            <td align="center">
                <input name="inlands/inland[${flag}${index}]/coop_formal" label="合作形式" type="text" required class="input_css required " style="width: 80%;" maxlength="100"
                       value="<x:out select="$inland/coop_formal" />" />
            </td>

            <td align="center">
                <input name="inlands/inland[${flag}${index}]/coop_fund_expend" label="合作经费支出" type="text" required class="input_css " style="width: 80%;text-align: right;" maxlength="100" onfocus="InitInput.setNumber(this,9,2,2)"
                       value="<x:out select="$inland/coop_fund_expend" />" />
            </td>

            <td>
                <input name="inlands/inland[${flag}${index}]/psn_name" label="联系人" type="text" required class="input_css required " style="width: 80%;" maxlength="100"
                       value="<x:out select="$inland/psn_name" />" />
            </td>
            <td>
                <input name="inlands/inland[${flag}${index}]/psn_phone" label="电话" type="text" required class="input_css  required " style="width: 80%;" maxlength="20"
                       value="<x:out select="$inland/psn_phone" />" />
            </td>
            <td>
                <c:set var="triangle_region"><x:out select="$inland/triangle_region_value" /></c:set>
                <cpt:select id="triangle_region${flag}${index}" key="no_yes" name="triangle_region" onChange="initControlValue(this.id);setCooperationUnits();" value="${triangle_region }" style="width:85%"></cpt:select>
                <input type="hidden" name="inlands/inland[${flag}${index}]/triangle_region_value" class="required" value="<x:out select="$inland/triangle_region_value" />"  label="是否长三角区域" />
                <input type="hidden" name="inlands/inland[${flag}${index}]/triangle_region_name" value="<x:out select="$inland/triangle_region_name" />"/>
            </td>
            <td>
                <c:set var="county_units"><x:out select="$inland/county_units_value" /></c:set>
                <cpt:select id="county_units${flag}${index}" key="no_yes" name="county_units" onChange="initControlValue(this.id);setCooperationUnits();" value="${county_units }" style="width:85%"></cpt:select>
                <input type="hidden" name="inlands/inland[${flag}${index}]/county_units_value" class="required" value="<x:out select="$inland/county_units_value" />"  label="是否县域单位" />
                <input type="hidden" name="inlands/inland[${flag}${index}]/county_units_name" value="<x:out select="$inland/county_units_name" />"/>
            </td>
        </tr>
        <c:set var="beggerClass"></c:set>
        <c:set value="${index+1}" var="index" scope="page" />
    </x:forEach>
    </tbody>
</table>

<table width="98%" class="not_table">
    <tr>
        <td>
            <input class="button_02" type="button" name="cmdAddbefore" value="添加" onclick="if(checkTabLimit('inland',5,'合作单位信息最多只能填写5条')){addNewRow('inland');}try{top.resizeFrame();}catch(e){};setCooperationUnits();getLen()" />
            <input class="button_02" name="cmdMovePrev" type="button" value="上移" onclick="movePrev('inland');setCooperationUnits()" />
            <input class="button_02" name="cmdMoveNext" type="button" value="下移" onclick="moveNext('inland');setCooperationUnits()" />
            <input class="button_02" name="cmddel" type="button" value="删除" onclick="deleteSelectedRow('inland','合作单位信息');setCooperationUnits();getLen()" />
        </td>
    </tr>
</table>
<input type="hidden" name="proposal/effectivenes_units" id="effectivenes_units" value="<x:out select='$xmlData/data/proposal/effectivenes_units'/>"/>
<input type="hidden" id="age" name="proposal/attach_age" value="<x:out select="$xmlData/data/proposal/attach_age" />"/>

<div class="t_bar"><span class="color_red">*</span>项目简述（限500字）</div>
<table id="tblMileStones0" cellpadding="0" class="table01 t_css" width="100%" border="0" cellpadding="0" style="*border-bottom: #a1c0dc 1px solid;word-break:break-all;">
    <col style="width:34%"/>
    <col style="width:40%"/>
    <col style="width:13%"/>
    <col style="width:13%"/>
    <tr>
        <td colspan="4">
            <p >包括但不限于以下内容：项目的重要意义，创新水平；项目研究内容及路线；可量化考核主要指标（包括转化应用、产业化等）。</p>
        </td>
    </tr>
    <tr>
        <td colspan="4">
            <textarea name="project/summary0"  class="input_textarea required maxlength:500" label="项目简述" rows=5 style="width:98%"><x:out select="$xmlData/data/project/summary0" /></textarea>
            <input type="hidden" name="project/summary0_hidden" id="project/summary0_hidden" value="<x:out select="$xmlData/data/project/summary0" />"/>
        </td>
    </tr>
</table>
<input type="hidden" id="if_have_org" name="proposal/if_have_org">

<div class="t_bar"><span class="color_red">*</span>课题分解</div>
<table id="ktfj" border="0" cellspacing="0" cellpadding="0"  class="table01 t_css" style="width: 100%;word-break:break-all;">
    <thead>
    <tr>
        <th align="center" width="5%">选择</th>
        <th align="center" width="5%">序号</th>
        <th align="center" width="20%">课题名称</th>
        <th align="center" width="25%">承担单位</th>
        <th align="center" width="15%">负责人</th>
        <th align="center" width="15%">总经费（万元）</th>
        <th align="center" width="15%">其中省财政专项资金 （万元）</th>
    </tr>
    </thead>
    <tbody id="inland_tab2">
    <tr style="display: none" align="center">
        <td align="center">
            <input type="radio" class="radiobutton" name="selAttend">
        </td>
        <td align="center">
            <span name="inlands2|inland[0]@seq_no">[index]</span>
        </td>
        <td align="center">
            <input name="inlands2|inland[0]|kt_name" label="课题名称" type="text" required class="input_css required maxlength:100" style="width: 80%;" maxlength="100" value="" />
        </td>

        <td align="center">
            <input name="inlands2|inland[0]|cddw" label="承担单位" type="text" required class="input_css required maxlength:100" style="width: 80%;" maxlength="100" value="" />
        </td>

        <td align="center">
            <input name="inlands2|inland[0]|fzr" label="负责人" type="text" required class="input_css required " style="width: 80%;" maxlength="100" value="" />
        </td>

        <td align="center">
            <input name="inlands2|inland[0]|zjf" label="总经费" type="text" required class="input_css required " style="width: 80%;text-align: right;"
                    onfocus="InitInput.setNumber(this,9,4,2)"  value="" />
        </td>

        <td align="center">
            <input name="inlands2|inland[0]|zxzj" label="其中省财政专项资金" type="text" class="input_css required" style="width: 80%;text-align: right;"
                    value="" onfocus="InitInput.setNumber(this,9,4,2)"  />
        </td>
    </tr>
    <c:set value="0" var="index" scope="page" />
    <x:forEach select="$xmlData/data/inlands2/inland" var="inland2">
        <c:choose>
            <c:when test="${index<10}">
                <c:set value="0" var="flag" scope="page" />
            </c:when>
            <c:otherwise>
                <c:set value="" var="flag" scope="page" />
            </c:otherwise>
        </c:choose>
        <tr align="center">
            <td>
                <input type="radio" class="radiobutton" name="selAttendOrg11">
            </td>
            <td align="center">
					<span name="inlands2/inland[${flag}${index}]@seq_no"><x:out select="$inland2/@seq_no" /></span>
            </td>
            <td>
                <input name="inlands2/inland[${flag}${index}]/kt_name" label="课题名称" type="text" required class="input_css required maxlength:100" style="width: 80%;"
                       maxlength="100" value="<x:out select="$inland2/kt_name" />" />
            </td>

            <td>
                <input name="inlands2/inland[${flag}${index}]/cddw" label="承担单位" type="text" required class="input_css required maxlength:100" style="width: 80%;"
                       maxlength="100" value="<x:out select="$inland2/cddw" />" />
            </td>


            <td align="center">
                <input name="inlands2/inland[${flag}${index}]/fzr" label="负责人" type="text" required class="input_css required " style="width: 80%;"
                       maxlength="100" value="<x:out select="$inland2/fzr" />" />
            </td>

            <td align="center">
                <input name="inlands2/inland[${flag}${index}]/zjf" label="总经费" type="text" required class="input_css required " style="width: 80%;text-align: right;"
                         onfocus="InitInput.setNumber(this,9,4,2)" value="<x:out select="$inland2/zjf" />" />
            </td>

            <td align="center">
                <input name="inlands2/inland[${flag}${index}]/zxzj" label="其中省财政专项资金" type="text" required class="input_css " style="width: 80%;text-align: right;"
                         onfocus="InitInput.setNumber(this,9,4,2)" value="<x:out select="$inland2/zxzj" />" />
            </td>
        </tr>
        <c:set var="beggerClass"></c:set>
        <c:set value="${index+1}" var="index" scope="page" />
    </x:forEach>
    </tbody>
</table>

<table width="98%" class="not_table">
    <tr>
        <td>
            <input class="button_02" type="button" name="cmdAddbefore" value="添加" onclick="if(checkTabLimit('ktfj',10,'课题分解最多只能填写10条')){addNewRow('ktfj');}try{top.resizeFrame();}catch(e){};setCooperationUnits();getLen()" />
            <input class="button_02" name="cmdMovePrev" type="button" value="上移" onclick="movePrev('ktfj');setCooperationUnits()" />
            <input class="button_02" name="cmdMoveNext" type="button" value="下移" onclick="moveNext('ktfj');setCooperationUnits()" />
            <input class="button_02" name="cmddel" type="button" value="删除" onclick="deleteSelectedRow('ktfj','课题分解');setCooperationUnits();getLen()" />
        </td>
    </tr>
</table>

<script type="text/javascript">

    // //自动求和
    // function reformatRequestAmt(){
    //     var sczbk=0.00;//省财政拨款
    //     var lyhj=0.00;//来源合计
    //
    //     $("#ktfj").find("tr:gt(1)").each(function(){
    //         var zjf =  parseFloat($(this).find("[name$='zjf']").val());
    //         var zxzj = parseFloat($(this).find("[name$='zxzj']").val());
    //
    //         if(zjf!='' && !isNaN(zjf)){
    //             sczbk += zjf;
    //         }
    //         if(zxzj!='' && !isNaN(zxzj)){
    //             lyhj += zxzj;
    //         }
    //     });
    //     sczbk = formatNumberAuto2(sczbk.toString(), 9, 4, 2);// 格式化金额
    //     lyhj = formatNumberAuto2(lyhj.toString(), 9, 4, 2);// 格式化金额
    //
    //     $("#total_each_0").val(sczbk);
    //     $("#total_investfrom_5").val(lyhj);
    // }

    function formatNumberAuto2(number, maxIntLength, maxDecimalLength, displayDecimal) {
        if (number.indexOf(".") >= 0) {// 如果是输入值中带有小数点则检查小数部分长度是否达到了最低显示的长度，如果没有则补0
            var integral = "";
            var decimal = "";
            if (number.indexOf(".") == 0 && number.length > 1) {
                integral = "0";
                decimal = number.substring(1, number.length);
            } else if (number.indexOf(".") > 0) {
                integral = number.substring(0, number.indexOf("."));
                decimal = number.substring(number.indexOf(".") + 1, number.length);

                if (decimal.length ==1 && decimal.length <2){
                    decimal = decimal +"0"
                }
                if (decimal.length ==3 && decimal.length <4){
                    decimal = decimal +"0"
                }
                if (decimal.length >4 ){
                    decimal = decimal.substring(0, 4);
                }
            }
            number = integral + "." + decimal;
        }else {
            integral = number;
            number = integral +".00";

        }

        return number;
    }



    $(function(){
        industrial_enterprise();
        emerging_enterprises();
        involve();
        getLen();
        $("#tab1").click();
        $("#fragment-tab1 :text,#fragment-tab1 [type='date']").addClass("input_width");
        $("#fragment-tab1 select").addClass("select_width");
        emerging_enterprise1();


    });

    $(document).ready(function(){
        // compare_age();
        industrial_enterprise();
        if($('input:checkbox[name="enterprise_scale"]:checked').val()=="中小企业"){
            $("#technologyEnterprise").removeAttr("disabled");
        }else{
            $("#technologyEnterprise").attr("disabled",true);
        }
    });
    $("table").addClass("table01");
    $("#checkbox_table_").removeClass("table01");
    $("#feaReport_upload").removeClass("table01");
    $('div').find("[id^='checkbox_dyn_']").find("tr").removeClass("li_1").removeClass("li_2");
    $('div').find("[id^='checkbox_dyn_']").find("td").css("border",'0px solid');
    function initTreeValueExt(treeId, treeNode) {
        if ((treeNode && treeNode.isParent)) {
            scmWarn("请选择具体的" + $("#" + treeId).attr("label"));
            $("#" + treeId).val("");
            $("#" + treeId).parents("td").find("[name$='" + treeId + "_code'],[id$='" + treeId + "_code']").val("");
            $("#" + treeId).parents("td").find("[name$='" + treeId + "_value'],[id$='" + treeId + "_value']").val("");
            $("#" + treeId).parents("td").find("[name$='" + treeId + "_name'],[id$='" + treeId + "_name']").val("");
            return false;
        }
        var str = treeNode.name;
        var obj = treeNode.parentNode;
        while (obj != null) {
            str = obj.name + "-" + str;
            obj = obj.parentNode;
        }

        $("#" + treeId).parents("td").find("[name$='" + treeId + "_code'],[id$='" + treeId + "_code']").val(treeNode.id);
        $("#" + treeId).parents("td").find("[name$='" + treeId + "_value'],[id$='" + treeId + "_value']").val(treeNode.id);
        $("#" + treeId).parents("td").find("[name$='" + treeId + "_name'],[id$='" + treeId + "_name']").val(str);
    }


    /*
    function initControlValue(objId){

            var name="";
            var obj=$("#"+objId);
            if(obj.is("select")){
                name=obj.attr("name");
                obj.parent().children("input[name$='"+name+"_value'][type='hidden']").val($("#"+objId).find("option:selected").val());
                $("#"+objId).parent().children("input[name$='"+name+"_name']").val($("#"+objId).find("option:selected").text());
            }

            else if(obj.is(":radio")){
                name=obj.attr("name");
                if(obj.is(":checked")){//如果被选中
                    //alert($("#"+objId).val());
                    obj.parents("table").find("input[name$='"+name+"_value'][type='hidden']").val($("#"+objId).val());
                    $("#"+objId).parent().children("input[name$='"+name+"_name']").val($("#"+objId).next().text());
                }
                else{

                    obj.parents("table").find("input[name$='"+name+"_value'][type='hidden']").val("");
                }
            }else if(obj.is(":checkbox")){
                name=obj.attr("name");
                if(obj.is(":checked"))//如果被选中
                    obj.parent().find("input[name$='"+name+"_value'][type='hidden']").val($("#"+objId).val());
                else
                    obj.parent().find("input[name$='"+name+"_value'][type='hidden']").val("");
            }else{
                name=obj.attr("id");
                obj.parents("td").find("input[name$='"+name+"_name'][type='hidden']").val(obj.val());
                obj.parents("td").find("input[name$='"+name+"_code'][type='hidden']").val($("#"+objId+"_hideId").val());
            }
        }
    */

    function synchronizationAmount1(){
        var built_institute=$("#built_institute").val();
        if(built_institute !=  ""){
            $("span[id='built_institute_[00]']").html($("#built_institute").val());
            /*$("#total_fund_18").val(parseFloat($("#request_amount").val()).toFixed(2));*/
        }else if(built_institute ==  ""){
            $("input[id='built_institute_[00]']").html("");
        }
    }
    function setCooperationUnits(){
        var cooperation_units="";
        $("#inland tr:gt(1)").each(function(index){
            var cooperation_unit = $(this).find("td:eq(2) input").val().trim();
            /*var orgName = $("#org_name").val().trim();*/
            var orgName = $('span[name$="organizations/organization/org_name"]').html()
            if(!isBlankOrNull(cooperation_unit) && cooperation_unit!=orgName){
                cooperation_units += cooperation_unit+",";
            }
            /* if(!isBlankOrNull(cooperation_unit)){
                 cooperation_units += cooperation_unit+",";
             }*/
        });
        if(cooperation_units!=""){
            cooperation_units=cooperation_units.substring(0,cooperation_units.length-1);
        }
        $("#cooperation_units").val(cooperation_units);
    }
    /***
     * 勾选中小型企业框时打开科技型中小企业选择
     * 没有勾选时关闭科技型中小企业选择，并清除隐藏域的值
     *
     */
    function removeDisabled(){
        if($('input:checkbox[name="enterprise_scale"]:checked').val()=="中小企业"){
            $("#technologyEnterprise").removeAttr("disabled");
        }else{
            $("#technologyEnterprise").removeAttr("checked");
            $("#technology_enterprise_value").val("");
            $("#technologyEnterprise").attr("disabled",true);
        }
    };
    function initTreeValueExt(treeId, treeNode) {
        if (!(treeNode && (treeNode.level > 0 || !treeNode.isParent))) {
            scmWarn($("#" + treeId).attr("label") + messageTip.researchAreaInvalidDisciplineCode);
            if (treeNode.level == 0) {
                $("#" + treeId).val("");
                $("#" + treeId).parents("td").find("[name$='" + treeId + "_code'],[id$='" + treeId+ "_code']").val("");
                $("#" + treeId).parents("td").find("[name$='" + treeId + "_value'],[id$='" + treeId+ "_value']").val("");
                $("#" + treeId).parents("td").find("[name$='" + treeId + "_name'],[id$='" + treeId+ "_name']").val("");
            }
            return false;
        }
        var str = treeNode.name;
        var obj = treeNode.parentNode;
        while (obj != null) {
            obj = obj.parentNode;
        }
        $("#" + treeId).parents("td").find("[name$='" + treeId + "_code'],[id$='" + treeId+ "_code']").val(treeNode.id);
        $("#" + treeId).parents("td").find("[name$='" + treeId + "_value'],[id$='" + treeId+ "_value']").val(treeNode.id);
        $("#" + treeId).parents("td").find("[name$='" + treeId + "_name'],[id$='" + treeId+ "_name']").val(str);
    }
    // function compare_age() {
    //     var end_date = $("#age_end_date").val();
    //     var birthday = $("#fzbirthday").val();
    //
    //     var end_date_year = Number(end_date.substring(0,4));
    //     var birthday_year = Number(birthday.substring(0,4));
    //
    //     var end_date_month = Number(end_date.substring(5,7));
    //     var birthday_month = Number(birthday.substring(5,7));
    //
    //     var end_date_day = Number(end_date.substring(8));
    //     var birthday_day = Number(birthday.substring(8));
    //
    //     var different_value = end_date_year - birthday_year -57;
    //     var different_value1 = end_date_month - birthday_month;
    //     var different_value2 = end_date_day - birthday_day;
    //
    //     if(different_value > 0 || (different_value == 0 && different_value1 > 0 )  || (different_value == 0 && different_value1 == 0  && different_value2 > 0)){
    //         $("#age").val(1);
    //     }else{
    //         $("#age").val(0);
    //     }
    //     //onchangeType2();
    //
    // }

    /*$("#industrial_enterprise_value").onchange(function(industrial_enterprise){
        var industrial_enterprise_value = $("#industrial_enterprise_value").val();
        if(industrial_enterprise_value==1){
            $("#industrial_value").val(1);
        }else{
            $("#industrial_value").val(0);
        }
    });*/

    function industrial_enterprise() {
        var industrial_enterprise_value = $("#industrial_enterprise_value").val();
        if(industrial_enterprise_value==0){
            $("#industrial_value").val(1);
        }else if(industrial_enterprise_value==1){
            $("#industrial_value").val(0);
        }else {
            $("#industrial_value").val("");
        }

    }
    function emerging_enterprises() {
        var emerging_enterprises_value = $("#emerging_enterprises_value").val();
        if (emerging_enterprises_value == '0') {
            $("#emerging_industries_value_div").attr("style","display:block");
            $("#emerging_industries_value").addClass("required");
        } else{
            $("#emerging_industries_value_div").attr("style","display:none");
            $("input[name='proposal/emerging_industries_value']").val('');
            $("input[name='proposal/emerging_industries_name']").val('');
            $("#checkbox_dyn_emerging_industries").find("td input[type='checkbox']").attr("checked",false);
            $("#emerging_industries_value").removeClass("required");
        }
    }

    function involve() {
        var involve_value = $("#involve_value").val();
        if (involve_value == '0') {
            $("#related_activities_value_div").attr("style","display:block");
            $("#related_activities_value").addClass("required");
        } else{
            $("#related_activities_value_div").attr("style","display:none");
            $("input[name='proposal/related_activities_value']").val('');
            $("input[name='proposal/related_activities_name']").val('');
            $("#checkbox_dyn_related_activities").find("td input[type='checkbox']").attr("checked",false);
            $("#related_activities_value").removeClass("required");
        }
    }



    function getLen() {
        var len=$("#inland tr:gt(1)").length;
        if(len>=1){
            $("#if_have_org").val("1");
        }else{
            $("#if_have_org").val("0");
        }
    }

    function emerging_enterprise1() {
        var emerging_enterprise_value = $("#emerging_enterprise_value").val();
        if (emerging_enterprise_value == "0") {
            $(".hid").removeClass("hide");
            $(".hid").addClass("required");
        } else{
            $(".hid").addClass("hide");
            $(".hid").removeClass("required");
            $("#other_content").val("");

        }
    }
</script>
